import { loadFiles } from './utils';
const { map } = require('pointfree-fantasy');
const { pipe } = require('ramda');

// loadAllEventHandlers :: null -> Task any string -> Task any module
const loadAllEventHandlers = pipe(
    () => loadFiles(`${__dirname}/../api/**/*.handler.@(ts|js)`, ['**/node_modules/**']),
    map(map(require))
);

export { loadAllEventHandlers }